<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>login</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link rel="stylesheet" type="text/css"
			href="../static/css/style.css" />
		<script >
			/*添加点击事件*/
			$(function (){
				$(".button").click(doLogin);
			})

			function doLogin(){

				var params={
					username:$("#usernameId").val(),
					password:$("#passwordId").val(),
				}
				var url="user/doLogin";
				/*console.log("params",params);*/
				$.post(url,params,function(result){
					console.log("login.result",result);
					if(result.state==1){
						//跳转到indexUI对应的页面
						location.href="doIndexUI?t="+Math.random();
					}else{
						$(".login-box-msg").html(result.message);
					}
					return false;//防止刷新时重复提交
				});
			}
		</script>
	</head>

	<body>
		<div id="wrap">
			<div id="top_content">
					<div id="header">
						<div id="rightheader">
							<p>
								2009/11/20
								<br />
							</p>
						</div>
						<div id="topheader">
							<h1 id="title">
								<a href="#">main</a>
							</h1>
						</div>
						<div id="navigation">
						</div>
					</div>
				<div id="content">
					<p id="whereami">
					</p>
					<h1>
						login
					</h1>
					<form action="emplist.html" method="post">
						<table cellpadding="0" cellspacing="0" border="0"
							class="form_table">
							<tr>
								<td valign="middle" align="right">
									username:
								</td>
								<td valign="middle" align="left">
									<input type="text" class="inputgri" name="name" id="usernameId"/>
								</td>
							</tr>
							<tr>
								<td valign="middle" align="right">
									password:
								</td>
								<td valign="middle" align="left">
									<input type="password" class="inputgri" name="pwd" id="passwordId"/>
								</td>
							</tr>
						</table>
						<p>
							<input type="button" class="button" value="登录 &raquo;" />
						</p>
					</form>
				</div>
			</div>
			<div id="footer">
				<div id="footer_bg">
					ABC@126.com
				</div>
			</div>
		</div>
	</body>
</html>
